//
//  UIView+FGExtension.h
//  Flashfish
//
//  Created by LWF on 2017/8/16.
//  Copyright © 2017年 dong9. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface UIView (FGExtension)

/**   添加蒙版 return coverView     */
- (UIView *)addCoverView;
/**    添加阴影 shadowOpacity为0.1    */
- (void)addShadow;
/**    添加阴影 shadowOpacity为0.1 */
- (void)addShadowWithCornerRadius:(CGFloat)CornerRadius;
- (void)addShadowWithOpacity:(float)shadowOpacity cornerRadius:(CGFloat)cornerRadius;

/**    默认：kTextDarkColor   kTextDefaultFont   */
- (UILabel *)addLabel;
/**    默认：kTextDarkColor   kTextDefaultFont   */
- (UILabel *)addLabel:(NSString *)str;

/**    添加分割线 return line    */
- (UIView *)addBottomLine;
/**    添加分割线 return line     */
- (UIView *)addBottomLineWithLeftSpace:(CGFloat)left;

/**    cornerRadius = 5     */
- (void)addCornerRadius;
- (void)addCornerRadius:(CGFloat)cornerRadius;
- (void)addBorderWithWidth:(CGFloat)width color:(UIColor *)color;

/**    加载xib中的第一个view     */
+ (instancetype)loadFromXib;

/**
 * 找到当前的控制层
 */
- (UIViewController *)firstAvailableUIViewController;

- (NSArray *)allSubviews;

/**
 *  得到当前屏幕的截图
 *
 *  @return 当前屏幕截图的image
 */
- (UIImage *)screenshot;

/**    键盘动画     */
+ (void)animateWithKeyboardNotification:(NSNotification *)notification animations:(void (^)(CGRect keyboardFrame,CGFloat duration,UIViewAnimationCurve curve))animations;




#pragma mark - addCAGradient
- (void)addCAGradient;
- (void)removeCAGradient;
- (void)addCAGradientFromColor:(UIColor *)from toColor:(UIColor *)to;

@end
